package com.yfp.operation.mapper;

import com.yfp.operation.domain.ClientBill;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yfp.operation.domain.dto.ClientBillsDTO;
import com.yfp.operation.domain.dto.StoredBillDTO;
import com.yfp.operation.domain.vo.StoredBillVO;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
* @author admin
* @description 针对表【client_bill(用户余额明细)】的数据库操作Mapper
* @createDate 2024-11-22 17:56:49
* @Entity domain.com.yfp.operation.ClientBill
*/
public interface ClientBillMapper extends BaseMapper<ClientBill> {

    /**
     * 储值记录
     * @param storedBillDTO
     * @return
     */
    List<StoredBillVO> storedBill(StoredBillDTO storedBillDTO);

    /**
     * 余额变动记录
     * @param clientBillsDTO
     * @return
     */
    List<ClientBill> clientBills(ClientBillsDTO clientBillsDTO);

    /**
     * 首充优惠券
     * @param clientId
     * @param activityId
     * @return
     */
    StoredBillVO oneRechargeCoupon(@Param("clientId") String clientId, @Param("activityId") Long activityId, @Param("cbId") Long cbId);

    /**
     * 储值优惠券
     * @param clientId
     * @param activityId
     * @return
     */
    StoredBillVO storedCoupon(@Param("clientId") String clientId, @Param("activityId") Long activityId, @Param("cbId") Long cbId);

    Integer getCount(@Param("createTime") Date createTime ,@Param("clientId") String clientId);

    /**
     * 统计剩余金额
     * @param clientId
     * @return
     */
    BigDecimal surplusMoney(String clientId);
}




